import React, { useState } from 'react'

function Count(props) {
  console.log('count组件挂载或更新了')
  const [count, setCount] = useState(0)
  return (
    <div>
      <h1>count组件</h1>
      <p>{`来自App组件的msg:${props.msg}`}</p>
      <p>{count}</p>
      <button
        onClick={() => {
          setCount(count + 1)
        }}
      >
        +
      </button>
    </div>
  )
}

export default React.memo(Count)
